import { createRouter, createWebHistory } from "vue-router";
import { baseRoute as routes } from "./config.js";

const router = createRouter({
  history: createWebHistory(),
  routes,
});

router.beforeEach = (to, from, next) => {
  console.log("???? to: ", to);

  if (to.meta?.whiteList) {
    next();
  } else {
    next("/login");
  }
};

export default router;
